﻿using System;
using System.Collections;
using mojoPortal.Web.Framework;

namespace eStore.UI
{
    public class eStoreConfiguration
    {
        public eStoreConfiguration()
        { }

        public eStoreConfiguration(Hashtable settings)
        {
            LoadSettings(settings);

        }

        private void LoadSettings(Hashtable settings)
        {
            if (settings == null) { throw new ArgumentException("must pass in a hashtable of settings"); }

            requireLoginToOrder = WebUtils.ParseBoolFromHashtable(settings, "RequireLoginToOrderSetting", requireLoginToOrder);

            enableRatingsInProductList = WebUtils.ParseBoolFromHashtable(settings, "EnableContentRatingInProductListSetting", enableRatingsInProductList);

            enableRatingComments = WebUtils.ParseBoolFromHashtable(settings, "EnableRatingCommentsSetting", enableRatingComments);

            showLastestFirstSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowLastestFirstSetting", showLastestFirstSetting);

            useTaxSystem = WebUtils.ParseBoolFromHashtable(settings, "UseTaxSystemSetting", useTaxSystem);

            indexProductsInSearch = WebUtils.ParseBoolFromHashtable(settings, "IndexProductsSetting", indexProductsInSearch);

            if (settings.Contains("eStoreLoaderSelectorSetting"))
            {
                eStoreLoaderSelectorSetting = settings["eStoreLoaderSelectorSetting"].ToString();
            }

            if (settings.Contains("CustomCssClassSetting"))
            {
                customCssClassSetting = settings["CustomCssClassSetting"].ToString();
            }

            pageSizeSetting = WebUtils.ParseInt32FromHashtable(settings, "PageSizeSetting", pageSizeSetting);

            showImageSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowImageSetting", showImageSetting);

            showPriceSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowPriceSetting", showPriceSetting);

            showPriceLabelSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowPriceLabelSetting", showPriceLabelSetting);

            if (settings.Contains("PriceLabelSetting"))
            {
                priceLabelSetting = settings["PriceLabelSetting"].ToString();
            }
            showNameBelowImageSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowNameBelowImageSetting", showNameBelowImageSetting);

            showDetailLinkSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowDetailLinkSetting", showDetailLinkSetting);

            showCartLinkSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowCartLinkSetting", showCartLinkSetting);
            
            showAddCartLinkSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowAddCartLinkSetting", showAddCartLinkSetting);

            showDescriptionSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowDescriptionSetting", showDescriptionSetting);

            descriptionLengthSetting = WebUtils.ParseInt32FromHashtable(settings, "DescriptionLengthSetting", descriptionLengthSetting);

            showSpecialProductsSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowSpecialProductsSetting", showSpecialProductsSetting);
            
            showOnlySpecialProductsSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowOnlySpecialProductsSetting", showOnlySpecialProductsSetting);

            autoScrollSetting = WebUtils.ParseBoolFromHashtable(settings, "AutoScrollSetting", autoScrollSetting);

            autoScrollVerticalSetting = WebUtils.ParseBoolFromHashtable(settings, "AutoScrollVerticalSetting", autoScrollVerticalSetting);

            autoScrollCircularSetting = WebUtils.ParseBoolFromHashtable(settings, "AutoScrollCircularSetting", autoScrollCircularSetting);

            autoScrollSpeedSetting = WebUtils.ParseInt32FromHashtable(settings, "AutoScrollSpeedSetting", autoScrollSpeedSetting);

            if (settings.Contains("AutoScrollHeightWrapperSetting"))
            {
                autoScrollHeightWrapperSetting = settings["AutoScrollHeightWrapperSetting"].ToString();
            }

            if (settings.Contains("AutoScrollWidthWrapperSetting"))
            {
                autoScrollWidthWrapperSetting = settings["AutoScrollWidthWrapperSetting"].ToString();
            }

            if (settings.Contains("AutoScrollEasingSetting"))
            {
                autoScrollEasingSetting = settings["AutoScrollEasingSetting"].ToString();
            }

            autoScrollTimeSetting = WebUtils.ParseInt32FromHashtable(settings, "AutoScrollTimeSetting", autoScrollTimeSetting);

            autoScrollItemsSetting = WebUtils.ParseInt32FromHashtable(settings, "AutoScrollItemsSetting", autoScrollItemsSetting);

            useEmailSystemOnlySetting = WebUtils.ParseBoolFromHashtable(settings, "UseEmailSystemOnlySetting", useEmailSystemOnlySetting);

            showBottomPanelSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowBottomPanelSetting", showBottomPanelSetting);

            showTopPanelSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowTopPanelSetting", showTopPanelSetting);

            showLeftPanelSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowLeftPanelSetting", showLeftPanelSetting);

            showRightPanelSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowRightPanelSetting", showRightPanelSetting);

            showCenterPanelSetting = WebUtils.ParseInt32FromHashtable(settings, "ShowCenterPanelSetting", showCenterPanelSetting);

            showStoreSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowStoreSetting", showStoreSetting);
            
            showProductAdminSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowProductAdminSetting", showProductAdminSetting);
            
            showDiscountAdminSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowDiscountAdminSetting", showDiscountAdminSetting);
            
            showOrderHistorySetting = WebUtils.ParseBoolFromHashtable(settings, "ShowOrderHistorySetting", showOrderHistorySetting);
            
            showBrowseCartSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowBrowseCartSetting", showBrowseCartSetting);
            
            showReportsSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowReportsSetting", showReportsSetting);
            
            showHeaderSpecialProductsSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowHeaderSpecialProductsSetting", showHeaderSpecialProductsSetting);
            
            showSpecialProductsCartSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowSpecialProductsCartSetting", showSpecialProductsCartSetting);
            
            showSpecialProductsLinkSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowSpecialProductsLinkSetting", showSpecialProductsLinkSetting);
            
            showSpecialProductsPriceSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowSpecialProductsPriceSetting", showSpecialProductsPriceSetting);
            
            showSpecialProductsDescriptionSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowSpecialProductsDescriptionSetting", showSpecialProductsDescriptionSetting);
            
            showSpecialProductsImageSetting = WebUtils.ParseBoolFromHashtable(settings, "ShowSpecialProductsImageSetting", showSpecialProductsImageSetting);
        }
        private bool showSpecialProductsCartSetting;

        public bool ShowSpecialProductsCartSetting
        {
            get { return showSpecialProductsCartSetting; }
        }

        private bool showSpecialProductsLinkSetting;

        public bool ShowSpecialProductsLinkSetting
        {
            get { return showSpecialProductsLinkSetting; }
        }

        private bool showSpecialProductsPriceSetting;

        public bool ShowSpecialProductsPriceSetting
        {
            get { return showSpecialProductsPriceSetting; }
        }

        private bool showSpecialProductsDescriptionSetting;

        public bool ShowSpecialProductsDescriptionSetting
        {
            get { return showSpecialProductsDescriptionSetting; }
        }

        private bool showSpecialProductsImageSetting;

        public bool ShowSpecialProductsImageSetting
        {
            get { return showSpecialProductsImageSetting; }
        }

        private bool showHeaderSpecialProductsSetting;

        public bool ShowHeaderSpecialProductsSetting
        {
            get { return showHeaderSpecialProductsSetting; }
        }


        private bool showStoreSetting = true;

        public bool ShowStoreSetting
        {
            get { return showStoreSetting; }
        }

        private bool showProductAdminSetting = true;

        public bool ShowProductAdminSetting
        {
            get { return showProductAdminSetting; }
        }

        private bool showDiscountAdminSetting = true;

        public bool ShowDiscountAdminSetting
        {
            get { return showDiscountAdminSetting; }
        }

        private bool showOrderHistorySetting = true;

        public bool ShowOrderHistorySetting
        {
            get { return showOrderHistorySetting; }
        }

        private bool showBrowseCartSetting = true;

        public bool ShowBrowseCartSetting
        {
            get { return showBrowseCartSetting; }
        }

        private bool showReportsSetting = true;

        public bool ShowReportsSetting
        {
            get { return showReportsSetting; }
        }

        private int showCenterPanelSetting;

        public int ShowCenterPanelSetting
        {
            get { return showCenterPanelSetting; }
        }

        private bool showBottomPanelSetting = true;

        public bool ShowBottomPanelSetting
        {
            get { return showBottomPanelSetting; }
        }

        private bool showTopPanelSetting = true;

        public bool ShowTopPanelSetting
        {
            get { return showTopPanelSetting; }
        }

        private bool showLeftPanelSetting = true;

        public bool ShowLeftPanelSetting
        {
            get { return showLeftPanelSetting; }
        }

        private bool showRightPanelSetting = true;

        public bool ShowRightPanelSetting
        {
            get { return showRightPanelSetting; }
        }

        private bool useEmailSystemOnlySetting = true;

        public bool UseEmailSystemOnlySetting
        {
            get { return useEmailSystemOnlySetting; }
        }

        private bool autoScrollSetting;

        public bool AutoScrollSetting
        {
            get { return autoScrollSetting; }
        }

        private bool autoScrollVerticalSetting;

        public bool AutoScrollVerticalSetting
        {
            get { return autoScrollVerticalSetting; }
        }

        private bool autoScrollCircularSetting;

        public bool AutoScrollCircularSetting
        {
            get { return autoScrollCircularSetting; }
        }

        private int autoScrollSpeedSetting = 5000;

        public int AutoScrollSpeedSetting
        {
            get { return autoScrollSpeedSetting; }
        }

        private string autoScrollHeightWrapperSetting = "100%";

        public string AutoScrollHeightWrapperSetting
        {
            get { return autoScrollHeightWrapperSetting; }
        }

        private string autoScrollWidthWrapperSetting = "100%";

        public string AutoScrollWidthWrapperSetting
        {
            get { return autoScrollWidthWrapperSetting; }
        }

        private string autoScrollEasingSetting = "linear";

        public string AutoScrollEasingSetting
        {
            get { return autoScrollEasingSetting; }
        }

        private int autoScrollTimeSetting = 1000;

        public int AutoScrollTimeSetting
        {
            get { return autoScrollTimeSetting; }
        }

        private int autoScrollItemsSetting = 1;

        public int AutoScrollItemsSetting
        {
            get { return autoScrollItemsSetting; }
        }


        private bool showOnlySpecialProductsSetting;

        public bool ShowOnlySpecialProductsSetting
        {
            get { return showOnlySpecialProductsSetting; }
        }


        private bool showSpecialProductsSetting;

        public bool ShowSpecialProductsSetting
        {
            get { return showSpecialProductsSetting; }
        }

        private bool enableRatingsInProductList;

        public bool EnableRatingsInProductList
        {
            get { return enableRatingsInProductList; }
        }

        private bool enableRatingComments;

        public bool EnableRatingComments
        {
            get { return enableRatingComments; }
        }

        private bool indexProductsInSearch;

        public bool IndexProductsInSearch
        {
            get { return indexProductsInSearch; }
        }

        private string eStoreLoaderSelectorSetting = string.Empty;

        public string EStoreLoaderSelectorSetting
        {
            get { return eStoreLoaderSelectorSetting; }
        }

        private string customCssClassSetting = string.Empty;

        public string CustomCssClassSetting
        {
            get { return customCssClassSetting; }
        }

        private int pageSizeSetting = 6;

        public int PageSizeSetting
        {
            get { return pageSizeSetting; }
        }

        private bool showImageSetting = true;

        public bool ShowImageSetting
        {
            get { return showImageSetting; }
        }

        private bool showPriceSetting = true;
        public bool ShowPriceSetting { get { return showPriceSetting; } }

        private bool showPriceLabelSetting = true;
        public bool ShowPriceLabelSetting { get { return showPriceLabelSetting; } }

        private string priceLabelSetting;
        public string PriceLabelSetting { get { return priceLabelSetting; } }


        private bool showNameBelowImageSetting;
        public bool ShowNameBelowImageSetting { get { return showNameBelowImageSetting; } }


        private bool showDetailLinkSetting;
        public bool ShowDetailLinkSetting { get { return showDetailLinkSetting; } }

        private bool showAddCartLinkSetting = true;
        public bool ShowAddCartLinkSetting { get { return showAddCartLinkSetting; } }
        
        private bool showCartLinkSetting;
        public bool ShowCartLinkSetting { get { return showCartLinkSetting; } }

        private bool showDescriptionSetting = true;

        public bool ShowDescriptionSetting
        {
            get { return showDescriptionSetting; }
        }

        private int descriptionLengthSetting = 200;

        public int DescriptionLengthSetting
        {
            get { return descriptionLengthSetting; }
        }

        private bool requireLoginToOrder;
        public bool RequireLoginToOrder { get { return requireLoginToOrder; } }

        private bool useTaxSystem;
        public bool UseTaxSystem { get { return useTaxSystem; } }

        private bool showLastestFirstSetting;
        public bool ShowLastestFirstSetting { get { return showLastestFirstSetting; } }

    }
}